﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LGE;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace UpUp
{
    public class GameObject : EngineObject
    {
        public static GameObject relativeObject = null;
        public Vector2 drawPosition = Vector2.Zero;
        public PlayScreen ps;

        public GameObject(PlayScreen ps, Texture2D sprite)
            : base(sprite)
        {
            this.ps = ps;
        }

        public override void Update(GameTime gameTime)
        {
        }

        public override void Draw(SpriteBatch spriteBatch)
        {
            if (alive && relativeObject != null)
            {
                drawPosition = position - relativeObject.position + relativeObject.drawPosition;
                spriteBatch.Draw(sprite, drawPosition, sourceRectangle, Color.White, rotation, origin, scale, SpriteEffects.None, 0);
            }
        }
    }
}
